/*
 * CopyRight(C) Kenbin
 */

#ifndef LWS_CRECOG_INCLUDED
#define LWS_CRECOG_INCLUDED

#include "lws_wordgraph.h"
#include "lws_hmm.h"
#include "lws_triedict.h"
#include <vector>

using namespace std;

namespace LWS {

    enum {
	UNKNOWN  = -1,
	NUMBER   = -2,
	TIME     = -3,
	PERSON   = -4,
	LOCATION = -5
    };

    class CPersonRecog
    {
	public:
	    CPersonRecog(CHmm *hmm);
	    void Recog(CWordGraph *word_graph, vector<int> &atom_trieidxs, bool is_split_cn);

	private:
	    enum RoleTags
	    {
		PER_SURNAME = 0,
		PER_GIVEN_SINGLE,
		PER_GIVEN_FIRST,
		PER_GIVEN_SECOND,
		PER_TRANS_BEGIN,
		PER_TRANS_MIDDLE,
		PER_TRANS_END,
		PER_PRE,
		PER_NEXT,
		OTHER
	    };

	    CHmmAlgo m_hmmalgo;
    };

    class CLocationRecog
    {
	public:
	    CLocationRecog(CHmm *hmm);
	    void Recog(CWordGraph *word_graph, vector<int> &atom_trieidxs);

	private:
	    enum RoleTags
	    {
		LOC_BEGIN = 0,
		LOC_MIDDLE,
		LOC_END,
		LOC_PRE,
		LOC_NEXT,
		OTHER
	    };

	    CHmmAlgo m_hmmalgo;
    };

    class CNumTimeRecog
    {
	public:
	    CNumTimeRecog(CTrieDict *dict);
	    void Recog(CWordGraph *word_graph, vector<const char *> &atom_ptrs, vector<int> &atom_trieidxs);

	private:
	    CTrieDict *m_dict;
    };

};

#endif
